package com.ww.springboot.boot.baseTest.design.guanchazhe.demo1;

import com.ww.springboot.boot.baseTest.design.guanchazhe.demo1.client.LiSi;
import com.ww.springboot.boot.baseTest.design.guanchazhe.demo1.client.Robot;
import com.ww.springboot.boot.baseTest.design.guanchazhe.demo1.client.ZhangSan;
import com.ww.springboot.boot.baseTest.design.guanchazhe.demo1.server.GameServer;


/**
 * 观察者模式
 *
 * @author wanwei
 * @since 2021-04-23 09:41
 */
public class Run {

    public static void main(String[] args) {

        GameServer gameServer = new GameServer();
        gameServer.inform();

        LiSi liSi = new LiSi();
        ZhangSan zhangSan = new ZhangSan();
        Robot robot = new Robot();

        gameServer.add(liSi);
        gameServer.add(zhangSan);
        gameServer.add(robot);
        gameServer.inform();


    }
}
